package com.xcity.game.rank;

import com.xcity.game.rank.impl.ArenaOfflineRankingList;
import com.xcity.game.rank.impl.ArenaOnlineRankingList;
import com.xcity.game.rank.impl.AssetsRankingList;
import com.xcity.game.rank.impl.BuildAttackRankingList;
import com.xcity.game.rank.impl.CharmRankingList;
import com.xcity.game.rank.impl.CircleTodayRankingList;
import com.xcity.game.rank.impl.CombatPowerRankingList;
import com.xcity.game.rank.impl.LevelRankingList;
import com.xcity.game.rank.impl.QQFriendsRankingList;
import com.xcity.game.rank.impl.VipRankingList;
import com.xcity.game.rank.impl.WorldBossRankingList;

public enum RankingListEnum {
	/** 固资排行榜 */
	ASSETS(new AssetsRankingList(0, 100, RankingComparator.VALUE_DESC_TIME_ASC), "资产榜"),
	/** 等级排行榜 */
	LEVEL(new LevelRankingList(1, 500, RankingComparator.VALUE_DESC_TIME_ASC), "等级榜"),
	/** 魅力排行榜 */
	CHARM(new CharmRankingList(2, 100, RankingComparator.VALUE_DESC_TIME_ASC), "魅力榜"),
	/** 掠夺排行榜 */
	BUILD_ATTACK(new BuildAttackRankingList(3, 100, RankingComparator.VALUE_DESC_TIME_ASC), "掠夺榜"),
	/** vip排行榜 */
	VIP(new VipRankingList(4, 100, RankingComparator.VALUE_DESC_TIME_ASC), "VIP榜"),
	/** 离线竞技场排行榜 */
	ARENA(new ArenaOfflineRankingList(5, 2000, RankingComparator.VALUE_DESC_TIME_ASC), "竞技场排行榜"),
	/** 当日转盘积分排行 */
	CIRCLETODAY(new CircleTodayRankingList(6, 500, RankingComparator.VALUE_TIME_DESC), "欢乐转盘排行榜"),
	/** 战斗力排行榜 */
	COMBAT_POWER(new CombatPowerRankingList(7, 100, RankingComparator.VALUE_DESC_TIME_ASC), "战力榜"),
	/** 在线竞技场排行（本服） */
	ARENA_ONLINE(new ArenaOnlineRankingList(8, 200, RankingComparator.VALUE_DESC_TIME_ASC), null),
	/** QQ好友战斗力排行榜 */
	QQ_FRIENDS_COMBAT_POWER(new QQFriendsRankingList(9, 200, RankingComparator.VALUE_DESC_TIME_ASC), "QQ好友排行榜"),
	/** 世界boss积分排行榜 */
	WORLD_BOSS(new WorldBossRankingList(10, 1000, RankingComparator.VALUE_TIME_DESC), "世界boss积分排行榜"),
	;
	
	public final RankingList instance;
	public final String name;
	
	public static RankingListEnum[] vals = values();
	
	RankingListEnum(RankingList instance, String name) {
		this.instance = instance;
		this.name = name;
	}
	
	public final <T extends RankingList> T castInstance() {
		return (T) instance;
	}

	public static RankingListEnum forType(byte type) {
		return type >= 0 && type < vals.length ? vals[type] : null;
	}

}
